#ifndef NATEONAPI_H
#define NATEONAPI_H

#include "NateOnApiEvents.h"

/////////////////////////////////////////////////////////////////////////////
// CDispNateComEnumBuddy wrapper class

class CDispNateComEnumBuddy : public COleDispatchDriver
{
public:
	CDispNateComEnumBuddy() {}		// Calls COleDispatchDriver default constructor
	CDispNateComEnumBuddy(LPDISPATCH pDispatch) : COleDispatchDriver(pDispatch) {}
	CDispNateComEnumBuddy(const CDispNateComEnumBuddy& dispatchSrc) : COleDispatchDriver(dispatchSrc) {}

// Attributes
public:

// Operations
public:
	void Reset();
	BOOL Next();
	long GetCount();
	long BuddyType();
	CString Id();
	CString Cmn();
	long OnlineStatus();
	long MediaType();
	CString Nick();
	CString Name();
	CString Email();
	CString Mobile();
	BOOL IsOffline();
	void SetEnum(long pParam);
	CString CyworldCmn();
	long Tong();
	long FRoomType();
	CString FRoomTitle();
	CString MusicDate();
};
/////////////////////////////////////////////////////////////////////////////
// CDispNateMessengerApi wrapper class

class CDispNateMessengerApi : public COleDispatchDriver
{
public:
	CDispNateMessengerApi() {m_pNateOnEvents = NULL;}		// Calls COleDispatchDriver default constructor
	CDispNateMessengerApi(LPDISPATCH pDispatch) : COleDispatchDriver(pDispatch) {}
	CDispNateMessengerApi(const CDispNateMessengerApi& dispatchSrc) : COleDispatchDriver(dispatchSrc) {}

// interface 
	BOOL CreateNateOnDispatch(void);
	BOOL ReleaseNateOnDispatch(void);

	BOOL DelelteEventSink();
	BOOL CreateEventSink();

// Attributes
public:
	ITNateMessengerApiEvents * m_pNateOnEvents;
	DWORD			m_dwCookie;

// Operations
public:
	void RegisterGUID(LPCTSTR bstrGuid);
	BOOL AddBuddy(LPCTSTR bstrId, LPCTSTR bstrGroupName);
	BOOL RemoveBuddy(LPCTSTR bstrId);
	BOOL BlockBuddy(LPCTSTR bstrId);
	LPDISPATCH GetBuddys(long eBuddyType);
	LPDISPATCH FindBuddy(LPCTSTR bstrId);
	BOOL IsBuddyOnline(LPCTSTR bstrId);
	void PopupMemo(LPCTSTR bstrId);
	void PopupMail(LPCTSTR bstrId);
	void PopupChat(LPCTSTR bstrId);
	void PopupSMS(LPCTSTR bstrId);
	void PopupAnyWindow(LPCTSTR bstrType, LPCTSTR bstrId, LPCTSTR bParam);
	long SendAppData(long eCmd, LPCTSTR bstrId, LPCTSTR bstrAppData, long wParam);
	CString GetMyId();
	CString GetMyCmn();
	CString GetMyTicket();
	long GetMyStatus();
	CString GetMyInfo(LPCTSTR bstrKey);

	BOOL GetAutoRun(LPCTSTR bstrGuid);
	void SetAutoRun(LPCTSTR bstrGuid, BOOL bSetAutoRun);

	BOOL GetAddressMoveFirst();
	BOOL GetAddressMoveNext();
	CString GetCurrentAddressItem();
	void AttachAddressItem(LPCTSTR bstrName, LPCTSTR bstrMobile, LPCTSTR bstrEmail, BOOL vbNateOnFriend);
	void InsertAttachedAddress();

	void UpdateMsgCnt(LPCTSTR bstrType, long nCnt, long nFlag);

	void MonitorBuddyEvent(LPCTSTR bstrId);

	void RefreshAddrBook();

	int SendMsgToGW(LPCTSTR bstrHeader, LPCTSTR bstrBody, long uBodyLen);

	CString GetPluginParameter(LPCTSTR bstrGUID);

	long MoveGroupFirst();
	long MoveGroupNext();
	CString GetCurGroupInfo(LPCTSTR bstrType);
	BOOL SetCurGroup(long nGid);
	BOOL MoveFirstBuddyInCurGroup();
	BOOL MoveNextBuddyInCurGroup();
	CString GetCurBuddyInCurGroup(LPCTSTR bstrType);

	BOOL ShowSlidWnd(LPCTSTR bstrCMD, LPCTSTR bstrText, LPCTSTR bstrAction);

	BOOL SetCustomValue(LPCTSTR strTarget, LPCTSTR strKey, LPCTSTR strValue);

    void SetMainWindow(const HWND& hWndMain);
};

#endif
